home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / pctjag86.arc / ATKEY.ASM < prev    next >
Assembly Source File  |  1986-05-29  |  3KB  |  61 lines

  1. ; ATKEY -- PC Tech Journal AT Keyboard Compatibility Test
  2. ;
  3. ; Version 1.00
  4. ; Last modified 05/23/86
  5. ; Copyright (c) 1986, PC Tech Journal
  6. ; Program by: Paul Pierce, Ted Forgeron, Steven Armbrust
  7. ;
  8. ; Checks for AT keyboard compatibility by trying to speed
  9. ; the keyboard typematic rate to 30 reps per second and a
  10. ; keyboard delay of 1/4 second.
  11. ;
  12. ; See AT Technical Reference Manual pages 4-5 thru 4-8 for
  13. ; more information on programming the AT keyboard.
  14.  
  15. code    segment public
  16.  
  17. assume cs:code,ds:code
  18.  
  19.         org     100h                    ;set up as a COM file
  20. start:  jmp     begin
  21.  
  22. msg     db 0dh,0ah
  23.         db 'ATKEY -- PC Tech Journal AT Keyboard Compatibility '
  24.         db 'Test',0dh,0ah
  25.         db 'Version 1.00, Copyright (c) 1986 PC Tech Journal',
  26.         db 0dh,0ah,0ah,'$'
  27. badmsg  db 'Keyboard is incompatible with IBM PC/AT keyboard',
  28.         db 0dh,0ah,'$'
  29. goodmsg db 'Keyboard is compatible with IBM PC/AT keyboard',
  30.         db 0dh,0ah,0dh,0ah
  31.         db 'Keyboard will now repeat at 30 characters per second',
  32.         db 0dh,0ah,'with 1/4 second delay.',0dh,0ah,'$'
  33.  
  34. begin:  mov     ax,cs                   ;set up ds
  35.         mov     ds,ax                   ;to same seg as cs
  36.         mov     dx,offset msg           ;print msg on screen
  37.         mov     ah,09h                  ;dos print string funct
  38.         int     21h                     ;call dos
  39.         mov     al,0f3h                 ;typematic rate cmd
  40.         mov     dx,60h                  ;8042 scan/diag port
  41.         mov     cx,2000                 ;ack retry count
  42.         out     dx,al                   ;send command to 8042
  43. ack:    in      al,60h                  ;in from 8042
  44.         dec     cx                      ;decrement retry count
  45.         jnz     cont                    ;try again
  46.         mov     dx,offset badmsg        ;print msg on screen
  47.         mov     ah,09h                  ;dos print string funct
  48.         int     21h                     ;call dos
  49.         jmp     done                    ;give up and terminate
  50. cont:   cmp     al,0fah                 ;is it an ack?
  51.         jne     ack                     ;no, try again
  52.         mov     al,0                    ;set rate to code for 30
  53.         out     dx,al                   ;output command to 8042
  54.         mov     dx,offset goodmsg       ;print msg on screen
  55.         mov     ah,09h                  ;dos print string funct
  56.         int     21h                     ;call dos
  57. done:   mov     ah,4ch                  ;dos terminate process
  58.         int     21h                     ;call dos
  59. code    ends                            ;end of code segement
  60.         end     start                   ;start is the entry point
  61.